<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8"  name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,initial-scale=1,user-scalable=no">
	<link rel="stylesheet" type="text/css" href="../css/gerenzhongxin.css">
	<script src="/js/jquery-3.1.0.js"></script>
	<title>个人中心</title>
</head>
<body>
<div class="content">
	<div class="head">
		<a href="index.html">
			<div class="backimg floatleft">
				<
				<div class="clear"></div>
			</div>
		</a>
		<div class="textstyle1floatleft">
			注册
			<div class="clear"></div>
		</div>
		<a href=http://www.baidu.com>
			<div class="backimg floatright">
				&nbsp;
				<div class="clear"></div>
			</div>
		</a>
	</div>
	<div id="basic">
		<div class="basic">基本信息</div>
	</div>
	<div id="basic-information" class="basic-information">
		<div class="touxiang">
			<div class="tupian">
				<img class="touxiang-tx" src="../images/111.png" />
			</div>
			<div class="touxiang-left">点击添加头像</div>
			<a href="http://www.baidu.com">
				<div class="touxiang-right" href="http://www.baidu.com">
					<img  class="youbiaoqian" src="../images/222.png">
				</div>
			</a>
			<div id="clear"></div>
		</div>
		<div class="name">
			<label>名称</label>
			<input  class="name1" type="text" placeholder="请输入2-16个字符" id="username" />
		</div>
		<div class="sex">
			<label>性别</label>
			<label><input name="sex" type="radio" value="" />先生</label>
			<label><input name="sex" type="radio" value="" />女士</label>
		</div>
		<div class="telphone" >
			<label>手机</label>
			<input class="name1" type="text" placeholder="中国大陆手机号" id="phonenumber"/>
		</div>

		<div class="telphone" >
			<label>密码</label>
			<input class="name1" type="text" placeholder="密码" id="password"/>
		</div>

		<div >
			<input id="button" type="button" value="注册">
			<div class="baocun">
			</div>
		</div>
		<div id="text01"></div>
		<div id="text02"></div>
	</div>
</div>

	<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='../js/utils.js'></script>


<!-- <script>

	$("#button").click(function () {

		var username=$("#username").val();
		var password= $("#password").val();
		var phonenumber=$("#phonenumber").val();


		var info= {
			username: username,
			password: password,
			phonenumber: phonenumber
		}

		  $.ajax({
					url:"/user/login.do",
					method:"POST",
					data:info,
					dataType: "json",

					success: function (result) {
						if (result) {
							//$('#username').val(result.username);
							$('#password').val(result.password);
							$('#phonenumber').val(result.phonenumber);
							//$("#text01").html("oo");
							location.href = "denglu.html";
						}
						else {
							$("#text01").html("手机号或者验证码错误");

						}

					}
				}
		)
	});

</script> -->


<script>
    $(function () {

 $('#phonenumber').on('blur', function () {
            var phonenumber = $('#phonenumber').val();          

            AjaxIO.post("/registercheck",
                                 {phonenumber: phonenumber},
                                     function (result) {
                                        alert(result.data.a);
                                    if (result.data.a==1) {                            
                                     $("#text01").html("手机号已注册");
                                    }
                                    
            });

        });



        
        $('#button').on('click', function () {
            var username = $('#username').val();
            var password = $('#password').val();
        	var phonenumber = $('#phonenumber').val();



            AjaxIO.post("/register",
                                 {username: username, password: password,phonenumber:phonenumber},
                                     function (result) {
                                        alert(result.data.aa);
                                    if (result.data.aa==1) {                            
                                       
                                        alert("100");
                                        location.href = "index.html";
                                    }
                                  
            });

        });


    });
</script>
</body>
</html>